import React from 'react';


import './index.less';

import PersonRefer from '../../../../../../public/components/PersonRefer';

import {base, getBusinessInfo} from 'nc-lightapp-front';
import {COMMON} from "../../../../main/util";

const {
    NCButton
} = base;
let businessInfo = getBusinessInfo() || {};
if (new RegExp(/^http:\/\/(localhost|127\.0\.0\.1):/g).test(window.location.href)) {
    businessInfo = {
        groupId: "0001AB10000000000N6U"
    }
}
export default (props) => {
    let funcPK = props.transMode === '3' ? "@@@@Z710000000006M4C" : "@@@@Z710000000006M7F";
    let personProps = {
        pk_org: props.pk_org,
        isIncludeKeyPsnGrp: true,
        transMode: props.transMode,
        GridRefActionExt: "nccloud.web.hryf.transapply.sqlbuilder.TransBatchPsnRefSqlBuilder",
        pk_group: businessInfo.groupId,
        funcPK,
    };
    return (
        <div className="batch-add-selectman">
            <div className="batch-add-selectman-condition-wrapper">
                <div
                    style={{
                        float: 'left'
                    }}
                >
                    <PersonRefer
                        refcode="hrhi/refer/hiref/PsnjobRefTreeGridRef/index"
                        clickContainer={
                            <NCButton>
                                {props.language['gx6008-000060']/** 参照选择 */}
                            </NCButton>
                        }
                        isMultiSelectedEnabled={true}
                        queryCondition={() => {
                            return personProps
                        }}
                        onChange={props.changePersonRefer}
                    />
                </div>
                <div
                    style={{
                        float: 'left'
                    }}
                >
                    <NCButton
                        onClick={props.openBatchAddSearchModal}
                    >
                        {props.language['gx6008-000061']/** 条件选择 */}
                    </NCButton>
                </div>
            </div>
            <div>
                {props.editTable.createEditTable(COMMON.addBranch, {
                    showCheck: true,
                    cancelCustomRightMenu: true,
                    onSelectedAll: props.selectedAll
                })}
            </div>
        </div>
    );

}
